<?

class RecordType {

	private $def;
	private $name;

	function __construct($name) {
		if (!@$_SESSION['rtcache'][$name]) {
			$def = mysqli_query($_SESSION['pconnect'], 'SHOW COLUMNS FROM `'.$name.'`');
			while ($field = mysqli_fetch_array($def, MYSQL_ASSOC)) {
				$res[] = $field['Field'];
			}
			$_SESSION['rtcache'][$name] = $res;
		}
		$this->def = $_SESSION['rtcache'][$name];
		$this->name = $name;
	}

	function get_def() {
		return $this->def;
	}

	function get_name() {
		return $this->name;
	}
}